package cn.itcast.controller;

import cn.itcast.pojo.Setmeal;
import cn.itcast.service.SetmealService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Reference
    SetmealService service;


    @RequestMapping("/getSetmeal.do")
    public List<Setmeal> getSetmeal() {

        List<Setmeal> list = service.findAll();
        return list;

    }



    @RequestMapping("/findById.do")
    public Setmeal findById(int id) {

        Setmeal meal = service.findById(id);

        return meal;

    }

}
